/**
 * Created By zhangQ 2018/2/12
 * 前台页面展示路由配置
 */

const index = () => import(/* webpackChunkName: "frontEnd" */ '@views/frontEnd')
const frontIndex = () => import(/* webpackChunkName: "frontEnd" */ '@views/frontEnd/frontIndex')
const about = () => import(/* webpackChunkName: "abouts" */ '@views/frontEnd/abouts/index.vue')
const productService = () => import(/* webpackChunkName: "productService" */ '@views/frontEnd/productService')
const productIndex = () => import(/* webpackChunkName: "productService" */ '@views/frontEnd/productService/productIndex.vue')
const stationService = () => import(/* webpackChunkName: "productService" */ '@views/frontEnd/productService/stationService.vue')
const finance = () => import(/* webpackChunkName: "productService" */ '@views/frontEnd/productService/finance.vue')
const hardware = () => import(/* webpackChunkName: "productService" */ '@views/frontEnd/productService/hardware.vue')
const mainOrder = () => import(/* webpackChunkName: "productService" */ '@views/frontEnd/productService/mainOrder.vue')
const waits = () => import(/* webpackChunkName: "wait" */ '@views/frontEnd/wait')
const commonProblem = () => import(/* webpackChunkName: "commonProblem" */ '@views/frontEnd/commonProblem')
// 路由是否验证
let required = false

let routers = []
/* 前端首页根路由 */
let frontendRouter = {
  path: '/',
  name: 'frontend',
  component: index,
  props: true,
  redirect: '/index',
  meta: { role: [], activeMenu: 'frontend', required: required },
  children: []
}
routers.push(frontendRouter)

/* 首页路由 */
let frontIndexRouter = {
  path: 'index',
  name: 'frontIndex',
  component: frontIndex,
  meta: { role: [], activeMenu: 'frontIndex', required: required }
}
frontendRouter.children.push(frontIndexRouter)

/* 关于我们 */
let aboutsRouter = {
  path: 'abouts',
  name: 'abouts',
  component: about,
  meta: { role: [], activeMenu: 'abouts', required: required }
}
frontendRouter.children.push(aboutsRouter)

/* 等待审核等待页面 */
let wait = {
  path: 'wait',
  name: 'wait',
  component: waits,
  meta: { role: [], activeMenu: 'frontend', required: required }
}
frontendRouter.children.push(wait)

/* 常见问题 */
let commonProblemRouter = {
  path: 'problem',
  name: 'problem',
  component: commonProblem,
  meta: { role: [], activeMenu: 'frontend', required: required }
}
frontendRouter.children.push(commonProblemRouter)

/* 产品与服务 */
let productServiceRouter = {
  path: 'product',
  name: 'productService',
  component: productService,
  redirect: 'product/index',
  meta: { role: [], activeMenu: 'productService', required: required },
  children: []
}
frontendRouter.children.push(productServiceRouter)

/* 产品与服务首页 */
let productIndexRouter = {
  path: 'index',
  name: 'productIndex',
  component: productIndex,
  meta: { role: [], activeMenu: 'productService', required: required }
}
productServiceRouter.children.push(productIndexRouter)

/* 智慧场站 */
let StationServiceRouter = {
  path: 'station',
  name: 'stationService',
  component: stationService,
  meta: { role: [], activeMenu: 'productService', required: required }
}
productServiceRouter.children.push(StationServiceRouter)

/* 智慧全程 */
let mainOrderRouter = {
  path: 'mainorder',
  name: 'mainOrder',
  component: mainOrder,
  meta: { role: [], activeMenu: 'productService', required: required }
}
productServiceRouter.children.push(mainOrderRouter)

/* 智能硬件 */
let hardwareRouter = {
  path: 'hardware',
  name: 'hardware',
  component: hardware,
  meta: { role: [], activeMenu: 'productService', required: required }
}
productServiceRouter.children.push(hardwareRouter)

/* 金融保理 */
let financeRouter = {
  path: 'finance',
  name: 'finance',
  component: finance,
  meta: { role: [], activeMenu: 'productService', required: required }
}
productServiceRouter.children.push(financeRouter)

export default routers
